const {getHttp} = require("../../utils/util")
Page({

   
    data: {
        musics:[],
        offset:1
    },

   
    onLoad: function (options) {
        var offset = this.data.offset
        getHttp(offset).then(res=>{
          
            var musics = res.data.data.list
            console.log(musics);
            this.setData({
                musics
            })
        })
    },
onReachBottom(){
console.log("bottom");
var offset = this.data.offset
offset+=20;
getHttp(offset).then(res=>{
    var musics = this.data.musics
    musics.push(...res.data.data.list)
    this.setData({
        musics,
        offset

    })
})
    }

   
})